@extends('template.adminpage')
@section('content')
 
<ol class="breadcrumb">
  <li class="active">Approving order</li>
</ol>

<div class="container-black">
  <label style="margin-top:10px"><u>Pencarian</u></label>
  	<form action="{{URL::to('/order/approvingorders')}}" method="POST">
      <div class="row">
      <div class="col-md-8">
        <div class="col-md-1">
          <input name="filter" value="date" type="radio" <?php if(Session::get('filter')=="date") echo "checked" ?> required ></input>
        </div>
        <div class="col-lg-2">
        <label>Tanggal</label>
        </div>
        <div class="col-lg-4">
          <div class="form-group">
                <div class='input-group date' id='datetimepicker1'>
                    <input type='text' class="form-control" name="datestart" style="height:30px" value="{{Session::get('datestart')}}"/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
        <script type="text/javascript">
            $(function () {
                $('#datetimepicker1').datetimepicker({
                    pickTime: false
                });
            });
        </script>
        </div>
        <div class="col-lg-1">
        <label>s/d</label>
        </div>
         <div class="col-lg-4">
           <div class="form-group">
                <div class='input-group date' id='datetimepicker2'>
                    <input type='text' class="form-control" name="dateend" style="height:30px" value="{{Session::get('dateend')}}"/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
        <script type="text/javascript">
            $(function () {
                $('#datetimepicker2').datetimepicker({
                    pickTime: false
                });
            });
        </script>
        </div>
      </div>

       <div class="col-md-3">
         <select  class="form-control" name="dateby" style="height:30px"/>
             <?php
            $type = array('all'=>'All','dateorder' => 'Tanggal order', 'dateapprove' => 'Tanggal approve');
            foreach ($type as $key => $val) {
                if ($key == Session::get('dateby')) {
                    echo '<option value="' . $key . '" selected>' . $val . '</option>';
                } else {
                    echo '<option value="' . $key . '">' . $val . '</option>';
                }
            }
            ?>
          </select>
      </div>


      </div>

      <div class="row">
      <div class="col-md-8">
        <div class="col-md-1">
          <input name="filter" value="type" type="radio" <?php if(Session::get('filter')=="type") echo "checked" ?>></input>
        </div>
        <div class="col-lg-2">
        <label>Jenis order</label>
        </div>
        <div class="col-lg-4">
           <select  class="form-control" name="typeby" style="height:30px" />
            <?php
            $type = array('all'=>'All','idcard' => 'ID Card', 'packaging' => 'Packaging', 'brochure' => 'Brosur', 'tshirt' => 'Kaos', 'nota' => 'Nota');
            foreach ($type as $key => $val) {
                if ($key == Session::get('list')) {
                    echo '<option value="' . $key . '" selected>' . $val . '</option>';
                } else {
                    echo '<option value="' . $key . '">' . $val . '</option>';
                }
            }
            ?>
          </select>
        </div>
      </div>
      </div>
      <br>


      <div class="row">
      <div class="col-md-8">
        <div class="col-md-1">
          <input name="filter" value="keyword" type="radio" <?php if(Session::get('filter')=="keyword") echo "checked" ?>></input>
        </div>
        <div class="col-lg-2">
        <label>Kata kunci</label>
        </div>
        <div class="col-lg-4">
          <input type="text"  class="form-control" placeholder="Kata kunci" name="keyword" style="height:30px" value="{{Session::get('keyword')}}"  /></input>
        </div>
        <div class="col-lg-4 col-md-offset-1">
          <select name="filterby" class="form-control"  style="height:30px" />
            <?php
            $type = array('code' => 'Kode order', 'name' => 'Nama pemesan');
            foreach ($type as $key => $val) {
                if ($key == Session::get('filterby')) {
                    echo '<option value="' . $key . '" selected>' . $val . '</option>';
                } else {
                    echo '<option value="' . $key . '">' . $val . '</option>';
                }
            }
            ?>
          </select>
        </div>
      </div>
      </div>
      <br>
      <div class="row">
      <div class="col-md-8">
        <div class="col-md-4 col-md-offset-3">
             <button class="btn btn-sm btn-dark" type="submit" style="width:100px;height:30px"><span class="fa fa-search"></span> Tampilkan</button>
        </div>
      </div>
      </div>
        

    </form>
  <label><u>Daftar approve</u></label>
    <br>

  <form action="{{URL::to('/order/approvingorder/process')}}"  method="post" >
    <p><button class="btn btn-sm btn-dark" type="submit" style="height:30px" ><span class="fa fa-gear"></span> Proses</button> <button class="btn btn-sm btn-dark" type="submit" style="height:30px" formaction="{{URL::to('/order/approvingorder/cancel')}}" ><span class="fa fa-times"></span> Cancel</button></p>
     <div class="table-responsive" >
      <?php  
        $limit = 5;
        if(Input::get('page')==0 OR Input::get('page')==1){ 
         $no = 1;
        }
        else{
        $no = ((Input::get('page')-1)*$limit)+1;
        } ?>
  	 <table class="table table-bordered table-hover">
      <thead>
        <tr>
          <th><input type="checkbox" name="checkall" id="terserah" onclick="check_all('terserah', {{$no}})" ></input></th>
          <th>No</th>
          <th>Tanggal approve</th>
          <th>Kode order</th>
          <th>Jenis order</th>
          <th>Jumlah order</th>
          <th>Total harga (INV/Fix)</th>
          <th>Dibayarkan (INV)</th>
          <th>Nama pemesan</th>
          <th>Aksi</th>
        </tr>
      </thead>
      <tbody>
        
        @foreach($approvingorder as $approving)
        <?php
        if($approving->order_name=='idcard'){$ordername = 'ID Card';}
        else if($approving->order_name=='packaging'){$ordername = 'Packaging';}
        else if($approving->order_name=='brochure'){$ordername = 'Brosur';}
        else if($approving->order_name=='nota'){$ordername = 'Nota';}
        else if($approving->order_name=='tshirt'){$ordername = 'T-Shirt';}
        
         
        $count = DB::table('sys_invoice')
          ->join('sys_invoice_detail','invoice_detail_invoice_id','=','invoice_id')
          ->where('invoice_order_id',$approving->order_id)
          ->count();
        $date = DB::table('sys_invoice')
          ->join('sys_invoice_detail','invoice_detail_invoice_id','=','invoice_id')
          ->where('invoice_order_id',$approving->order_id)
          ->orderBy('invoice_detail_date','DESC')
          ->first();
        
        ?>
         <td><input type="checkbox" name="{{$approving->order_id}}" value="1" id="terserah_{{$no}}" ></input></td>
         <td>{{$no}}</td>
         <td>{{date("d-M-Y",strtotime($approving->order_status_date))}}</td>
         <td>{{$approving->order_code}}</td>
         <td style="width:100px">{{$ordername}}</td>
         <td>{{$approving->order_qty.' '.$approving->order_qty_unit}}</td>
         <td>Rp {{number_format($approving->invoice_total_payment,0,'.','.')}}</td>
         <td><?php if($count<>0){ echo $date->invoice_detail_status.' : Rp '.number_format($date->invoice_detail_payment,0,'.','.');}else{ echo 'Rp 0';} ?></td>
      	 <td>{{$approving->customer_name}}</td>
          <td><!-- <button title="Cetak" onclick="window.open('{{URL::to('order/print/'.$approving->order_id)}}', '_blank');" formaction="" class="btn btn-xs btn-dark" ><span class="fa fa-print"></span></button> --> <a data-toggle="modal" data-target="#detail{{$approving->order_id}}" title="Detail"><button class="btn btn-xs btn-dark"><span class="fa fa-file-text-o"></span></button></a> <a data-toggle="modal" data-target="#{{$approving->order_id}}"><button class="btn btn-xs btn-dark" title="Set Pembayaran"><span class="fa fa-money"></span></button></a></td>
        <?php $no++; ?>
      </tbody>
        @endforeach
    </table>
      <div class="text-right"><?php echo $approvingorder->links(); ?></div>
  </div>
</form>

    @foreach($approvingorder as $approving)
    <?php
        if($approving->order_name=='idcard'){$ordername = 'ID Card';}
        else if($approving->order_name=='packaging'){$ordername = 'Packaging';}
        else if($approving->order_name=='brochure'){$ordername = 'Brosur';}
        else if($approving->order_name=='nota'){$ordername = 'Nota';}
        else if($approving->order_name=='tshirt'){$ordername = 'T-Shirt';}
         ?>
              <div class="modal fade" id="{{$approving->order_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Set order </label></h4>
                    </div>
                    <div align="left">
                              {{Form::open(array(
                                    'url' => '/order/approvingorder/setpayment/'.$approving->order_id,
                                    'method' => 'POST'
                                  ))}}
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Pemesan</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="text"  class="form-control" style="width:200px;height:30px" value="{{$approving->customer_name}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Kode</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="text"  class="form-control" style="width:200px;height:30px" value="{{$approving->order_code}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Jenis</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="text"  class="form-control" style="width:200px;height:30px" value="{{$ordername}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Jumlah</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="text"  class="form-control" style="width:200px;height:30px" value="{{$approving->order_qty.' '.$approving->order_qty_unit}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Total harga (INV/Fix)</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:200px;height:30px" value="Rp {{number_format($approving->invoice_total_payment,0,'.','.')}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Harga yang dibayar</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <input type="number" name="invoicedp" min="{{30/100*$approving->invoice_total_payment}}" class="form-control" style="width:200px;height:30px" placeholder="DP 30% = Rp {{number_format(30/100*$approving->invoice_total_payment,0,'.','.')}}" required /></input>
                                  </div>
                                  </div>
                                  <br>
                                  <div class="row">
                                  <div class="col-lg-4">
                                  <label>Jenis pembayaran</label>
                                  </div>
                                  <div class="col-lg-4">
                                    <select name="invoicetypedp" class="form-control" style="width:200px;height:30px" >
                                      <option value="Termin I (DP)">Termin I(DP)</option>
                                      <option value="Termin II">Termin II</option>
                                      <option value="Termin III">Termin III</option>
                                      <option value="Termin IV">Termin IV</option>
                                      <option value="Termin V">Termin V</option>
                                      <option value="Pelunasan">Pelunasan</option>
                                    </select>
                                  </div>
                                  </div>
                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">
                    


                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>
              @endforeach

              @foreach($approvingorder as $orderlist)


     <?php
        if($orderlist->order_name=='idcard'){
          $type = DB::table('sys_order_idcard')
                    ->where('order_idcard_order_id','=',$orderlist->order_id)
                    ->first();
          $ordername = 'ID Card ('.$type->order_idcard_quality_name.')';
        }
        else if($orderlist->order_name=='packaging'){
          $ordername = 'Packaging';
        }
        else if($orderlist->order_name=='brochure'){
          $type = DB::table('sys_order_brochure')
                        ->where('order_brochure_order_id','=',$orderlist->order_id)
                        ->first();
          if($type->order_brochure_type=="brochure"){
          $ordername = 'Brosur (Brosur)';
          }else if($type->order_brochure_type=="envelope"){
          $ordername = 'Brosur (Amplop)';
          }else if($type->order_brochure_type=="flayer"){
          $ordername = 'Brosur (Flayer)';
          }else if($type->order_brochure_type=="letterhead"){
          $ordername = 'Brosur (Kop Surat)';
          }
        }
        else if($orderlist->order_name=='nota'){
          $type = DB::table('sys_order_bill')
                        ->where('order_bill_order_id','=',$orderlist->order_id)
                        ->first();
          $ordername = $type->order_bill_name;
        }
        else if($orderlist->order_name=='tshirt'){
           $type = DB::table('sys_order_tshirt')
                        ->join('ref_tshirt_detail','tshirt_detail_id','=','order_tshirt_tshirt_id')
                        ->join('ref_tshirt','tshirt_id','=','tshirt_detail_tshirt_id')
                        ->where('order_tshirt_order_id','=',$orderlist->order_id)
                        ->first();
          $ordername = 'T-Shirt ('.$type->tshirt_type_of_material.')';
        }
         ?>
              <div class="modal fade" id="detail{{$orderlist->order_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg" style="width:50%">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:5px">Detail order</label></h4>
                    </div>
                    <div align="left">
                              
                          <div class="row" style="margin-top:5px">
                          <div class="col-md-10 col-md-offset-1">
                            <br>
                            <label>Data pemesan</label>
                            <legend></legend>
                            <div class="row">
                            <div class="col-md-12">
                            <div class="row">
                              <div class="col-md-4">
                                  Nama pemesan
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->customer_name}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Alamat pemesan
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->customer_address}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Nomor telepon
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->customer_phone}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Alamat email
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->customer_email}}</label>
                              </div>
                              <br>
                              <br>
                            </div>
                            </div>
                            </div>
                            
                            
                         

                            <br>
                            <label>Data order</label>
                            <legend></legend>
                            <div class="row">
                            <div class="col-md-12">
                            <div class="row">
                              <div class="col-md-4">
                                  Tanggal order
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{date("d-M-Y",strtotime($orderlist->order_date))}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Tanggal approve
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{date("d-M-Y",strtotime($orderlist->order_status_date))}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Kode order
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->order_code}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Jenis order
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$ordername}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Harga total (SO/Awal)
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>Rp {{number_format($orderlist->order_total_price,0,'.','.')}}</label>
                              </div>
                              <br>
                              <br>

                              <div class="col-md-4">
                                  Harga total (INV/Fix)
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>Rp {{number_format($orderlist->invoice_total_payment,0,'.','.')}}</label>
                              </div>
                              <br>
                              <br>


                              <div class="col-md-4">
                                  Dibayarkan (INV/Fix)
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                                <?php if($orderlist->invoice_detail_payment<>0){
                                  $invoice_detail_payment = $orderlist->invoice_detail_payment;
                                }else{
                                  $invoice_detail_payment = 0;
                                } ?>
                              <label>Rp {{number_format($invoice_detail_payment,0,'.','.')}}</label>
                              </div>
                              <br>
                              <br>


                              <div class="col-md-4">
                                  Status order
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->order_status}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Jumlah (QTY) order
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                              <label>{{$orderlist->order_qty.' '.$orderlist->order_qty_unit}}</label>
                              </div>
                              <br>
                              <br>
                              <div class="col-md-4">
                                  Desain
                              </div>
                              <div class="col-md-1">
                              :
                              </div>
                              <div class="col-md-7">
                               <?php if($orderlist->order_desain<>""){ ?>
                        <a href="{{URL::to($orderlist->order_desain)}}" target="_blank"><button class="btn btn-xs btn-info" style="width:130px"> Lihat dan download</button></a>

                             <?php  }else{ ?> 
                          <button class="btn btn-xs btn-info" style="width:130px" disabled> Tidak ada desain</button>

                             <?php } ?>
                              </div>
                              <br>
                              <br>
                            </div>
                            </div>
                            </div>



      <?php      
        if($orderlist->order_name=='idcard'){
          $type = DB::table('sys_order_idcard')
                    ->where('order_idcard_order_id','=',$orderlist->order_id)
                    ->first();
          $ordername = 'ID Card ('.$type->order_idcard_quality_name.')'; ?>

<label>Detail order</label>
        <legend></legend>
      <div class="row">
      <div class="col-md-12">
      <div class="row">
      <div class="col-md-4">
         Type ID Card
      </div>
      <div class="col-md-1">
      :
      </div>
      <div class="col-md-7">
      <label>{{$type->order_idcard_type_name}}</label>
      </div>
      <br>
      <br>
      <div class="col-md-4">
          Kualitas ID Card
      </div>
      <div class="col-md-1">
      :
      </div>
      <div class="col-md-7">
      <label>{{$type->order_idcard_quality_name}}</label>
      </div>
      <br>
      <br>
      <div class="col-md-4">
          Fitur tambahan
      </div>
      <div class="col-md-1">
      :
      </div>
      <div class="col-md-7">
      <?php $no = 1; 
        $detailorder =  DB::table('sys_order')
            ->join('sys_order_idcard','order_idcard_order_id','=','order_id')
            ->join('sys_order_idcard_detail','order_idcard_detail_order_idcard_id','=','order_idcard_id')
            ->join('ref_additional_features','order_idcard_detail_idcard_additional_features_id','=','additional_features_id')
            ->where('order_id','=',$orderlist->order_id)
            ->get();
      ?>
      @foreach($detailorder as $addfeature)
      <label>{{$no}}. {{$addfeature->additional_features_name}}</label><br>
      <?php $no++; ?>
      @endforeach
      </div>
      <br>
      <br>
      <br>
    </div>
    </div>
    </div>




     <?php   }
        else if($orderlist->order_name=='packaging'){
          $type = DB::table('sys_order_packaging')
                    ->where('order_packaging_order_id','=',$orderlist->order_id)
                    ->first();
          $ordername = 'Packaging ('.$type->order_packaging_type.')'; ?>
 <br>
                            <label>Detail order</label>
                            <legend></legend>
                                <div class="row">
                                <div class="col-md-12">
                                <div class="row">
                                <div class="col-md-4">
                                   Type packaging
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$ordername}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Ukuran (Dimensi)
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_packaging_size}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Jenis kertas
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_packaging_paper}} Cm</label>
                                </div>
                               
                                <br>
                                <br>
                                <br>
                              </div>
                              </div>

                            </div>



       <?php }
        else if($orderlist->order_name=='brochure'){
          $type = DB::table('sys_order_brochure')
                        ->where('order_brochure_order_id','=',$orderlist->order_id)
                        ->first();
          if($type->order_brochure_type=="brochure"){
          $ordername = 'Brosur (Brosur '.$type->order_brochure_color.' '.$type->order_brochure_qty_print_page.')';
          }else if($type->order_brochure_type=="envelope"){
          $ordername = 'Brosur (Amplop '.$type->order_brochure_color.' '.$type->order_brochure_qty_print_page.')';
          }else if($type->order_brochure_type=="flayer"){
          $ordername = 'Brosur (Flayer '.$type->order_brochure_color.' '.$type->order_brochure_qty_print_page.')';
          }else if($type->order_brochure_type=="letterhead"){
          $ordername = 'Brosur (Kop Surat '.$type->order_brochure_color.' '.$type->order_brochure_qty_print_page.')';
          } ?>

           <br>
                            <label>Detail order</label>
                            <legend></legend>
                                <div class="row">
                                <div class="col-md-12">
                                <div class="row">
                                <div class="col-md-4">
                                   Type brochure
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$ordername}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Ukuran (Dimensi)
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_brochure_size}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Jenis kertas
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_brochure_papertype}}</label>
                                </div>
                               
                                <br>
                                <br>
                                <br>
                              </div>
                              </div>

                            </div>


      <?php  }
        else if($orderlist->order_name=='nota'){
          $type = DB::table('sys_order_bill')
                        ->where('order_bill_order_id','=',$orderlist->order_id)
                        ->first();
          $ordername = $type->order_bill_name;?>

    <b id="title"><label>Detail order</label></b>
                            <legend></legend>
                                <div class="row">
                                <div class="col-md-12">
                                <div class="row">
                                <div class="col-md-4">
                                   Type nota
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$ordername}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Ukuran (Dimensi)
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_bill_size}}</label>
                                </div>
                                <br>
                                <br>
                                <div class="col-md-4">
                                    Jenis kertas
                                </div>
                                <div class="col-md-1">
                                :
                                </div>
                                <div class="col-md-7">
                                <label>{{$type->order_bill_papertype}}</label>
                                </div>
                               
                                <br>
                                <br>
                                <br>
                              </div>
                              </div>

                            </div>



        <?php }
        else if($orderlist->order_name=='tshirt'){
           $type = DB::table('sys_order_tshirt')
                        ->join('ref_tshirt_detail','tshirt_detail_id','=','order_tshirt_tshirt_id')
                        ->join('ref_tshirt','tshirt_id','=','tshirt_detail_tshirt_id')
                        ->where('order_tshirt_order_id','=',$orderlist->order_id)
                        ->first();
          $ordername = 'T-Shirt ('.$type->tshirt_type_of_material.')';?>
<label>Detail order</label>
        <legend></legend>
      <div class="row">
      <div class="col-md-12">
      <div class="row">
      <div class="col-md-4">
         Jenis bahan
      </div>
      <div class="col-md-1">
      :
      </div>
      <div class="col-md-7">
      <label>{{$type->tshirt_type_of_material}}</label>
      </div>
      <br>
      <br>
      <div class="col-md-4">
          Fitur tambahan
      </div>
      <div class="col-md-1">
      :
      </div>
      <div class="col-md-7">
      <?php $no = 1; 
        $detailorder =  DB::table('sys_order')
            ->join('sys_order_tshirt','order_tshirt_order_id','=','order_id')
            ->join('sys_order_tshirt_detail','order_tshirt_detail_order_tshirt_id','=','order_tshirt_id')
            ->join('ref_additional_features','order_tshirt_detail_additional_features_id','=','additional_features_id')
            ->where('order_id','=',$orderlist->order_id)
            ->get();
      ?>
      @foreach($detailorder as $addfeature)
      <label>{{$no}}. {{$addfeature->additional_features_name}}</label><br>
      <?php $no++; ?>
      @endforeach
      </div>
      <br>
      <br>
      <br>
    </div>
    </div>
    </div>



       <?php } ?>

                         
                             
                         
                
                    </div>
                    </div>
                    <div class="modal-footer">

                   <a href="{{URL::to('/order/approvingorder/process/'.$orderlist->order_id)}}"> <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-gear"></span> Proses</button></a> <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>
              </div>
              @endforeach
</div>


@stop
@stop